package com.antdesignbackend.backend.service.impl;

import com.antdesignbackend.backend.entity.Topic;
import com.antdesignbackend.backend.entity.entityVo.TopicVo;
import com.antdesignbackend.backend.mapper.TopicMapper;
import com.antdesignbackend.backend.service.TopicService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class TopicServiceImpl extends ServiceImpl<TopicMapper, Topic> implements TopicService {
    @Autowired
    TopicMapper topicMapper;
    public List<TopicVo> search(@Param(Constants.WRAPPER) QueryWrapper<TopicVo> queryWrapper, Page<TopicVo> page){
        return topicMapper.search(queryWrapper,page);
    };
    public Integer count(@Param(Constants.WRAPPER) QueryWrapper<TopicVo> queryWrapper){
        return topicMapper.count(queryWrapper);
    };
}
